interface IAuthorityUtils {
  /** 权限类型 */
  authorityType: IAuthorityType;

  /**
   * 权限的切换
   * @param {number} author - 权限
   * @param {number} type - 切换的权限类型
   * @returns {number} - 切换后的权限
   * */
  permissionSwitching: (author: number, type: number) => number;

  /**
   * 权限的判断
   * @param {number} author - 权限
   * @param {number} type - 判断的权限类型
   * @returns {boolean} - 是否有权限
   * */
  permissionJudgment: (author: number, type: number) => boolean;
}

/* ------------------------------------------------------------------------------------------------------------------ */

type IAuthorityType = {
  READ: 0b1; // 0001 读
  WRITE: 0b10; // 0010 写
  UPDATE: 0b100; // 0100 更新
  DEL: 0b1000; // 1000 删除
};

/* ------------------------------------------------------------------------------------------------------------------ */

export type { IAuthorityUtils, IAuthorityType };
